package com.zenika.zenbinding.client.renderer;

import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Widget;
import com.zenika.zenbinding.client.ZenBinder;
import com.zenika.zenbinding.client.feedback.DummyFeedbackManager;
import com.zenika.zenbinding.client.feedback.FeedbackManager;
import com.zenika.zenbinding.client.model.BusinessObject;

public class CheckBoxRenderer implements Renderer {
  
  private String property;
  private String style;
  
  public CheckBoxRenderer(String property) {
    this.property = property;
  }
  
  public Widget render(BusinessObject object) {
    CheckBox checkBox = new CheckBox();
    if ( this.style != null ) {
      checkBox.setStyleName(this.style);
    }
    ZenBinder.bindValue(checkBox, object, this.property);
    return checkBox;
  }
  
  public Widget render(BusinessObject source, DummyFeedbackManager manager) {
    // TODO Auto-generated method stub
    return null;
  }
  
  public void setStyleName(String style) {
    this.style = style;
  }
  
  public void setFeedbackManager(FeedbackManager manager) {

  }
  
}
